Keir Fraser [Sat, 16 Jul 2011 08:09:46 +0000 (09:09 +0100)]
xen/libxc: Clean up pv_cpuid switch statements.
Signed-off-by: Keir Fraser <keir@xen.org>
David Vrabel [Sat, 16 Jul 2011 08:05:45 +0000 (09:05 +0100)]
xen/libxc: set CPUID topology leaf as unsupported for PV guests
The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored. This can cause some guests
to loop endlessly when trying to enumerate the topology.
Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.
Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Roger Pau Monne [Fri, 15 Jul 2011 17:22:03 +0000 (18:22 +0100)]
tools: xencommons NetBSD init script: Multiple bugfixes and improvements
Added a cleanup of the xenstore database, to purge old entries,
prevented the restart of xenstore and set Domain-0 name. Also
replaced the sleep 5 (wait for xenstore to come up) with the method
used in the linux init script.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 15 Jul 2011 17:13:28 +0000 (18:13 +0100)]
xl: log domain suspension.
Other shutdown reasons all end up saying something useful while
suspend does not. With this patch the log looks like:
Domain 670 is dead
Domain has suspended.
Done. Exiting now
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 15 Jul 2011 17:12:55 +0000 (18:12 +0100)]
pygrub: prefer Grub2 to Grub1
If a VM image has grub2 installed it is likely the one we need to be using.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Fri, 15 Jul 2011 17:09:49 +0000 (18:09 +0100)]
xenbackendd: fix mistaken treatment of unknown backend (eg console) as VIF/VBD
Fixed a cleanup of a variable used in a loop and added a debug message.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:24:19 +0000 (13:24 +0100)]
libxl: add LIBXL_MAC_{FMT,FMTLEN,BYTES}
Modelled after LIBXL_UUID_... (where I also add FMTLEN).
signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:24:11 +0000 (13:24 +0100)]
libxl: rename testenum->testidl
I plan to add some non-Enumeration tests.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: bring command line handling in genwrap.py into one place.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: add helper to generate references to Aggregate type members.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: remove libxl_C_type_of
It's not really adding much...
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: refactor code to massage a type into a function argument
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: handle generation of pass-by-reference arguments.
Up until now everything with a destructor function happened to be
pass-by-reference so the current code worked but this will not be the case for
*_to_string and *_to_json. Put some infrastructure in place and use it.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: s/anonynous/anonymous/
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 14 Jul 2011 12:22:35 +0000 (13:22 +0100)]
build: define "move-if-changed" make macro.
Use it to replace various places which (should) use the
if ! cmp -s ...; then mv ....; fi
pattern.
Also add an else clause to cleanup the unchanged temporary file.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
tools/pygrub: fix solaris kernel sniff [Thu, 14 Jul 2011 17:09:58 +0000 (18:09 +0100)]
tools/pygrub: fix solaris kernel sniff
Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
This patch fixes the detection.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Frank Che <frank.che@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Stefano Stabellini [Thu, 14 Jul 2011 14:49:49 +0000 (15:49 +0100)]
libxl: Fix segfault in get_all_assigned_devices
pcidevs is an array of ndev elements (ndev is the number of pci devices
assigend to a specific domain), but we access pcidevs + *num
where *num is the global number of pci devices assigned so far to all
domains in the system.
Fix the issue removing pcidevs and just realloc'ing *list every time we
want to add a new pci device to the array.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 14 Jul 2011 08:43:37 +0000 (09:43 +0100)]
ns16550: Clean up code style
Signed-off-by: Keir Fraser <keir@xen.org>
Ross Philipson [Thu, 14 Jul 2011 08:35:40 +0000 (09:35 +0100)]
Placeholder for V4V hypercall and VIRQ numbers
The V4V Xen functionality is currently in our product trees for
XenClient b= ut is not yet in a state suitable for submission. We hope
to make available= the rest of the V4V functionality in the not too
distant future. Since the= se values are already in use in our
product, we would like to reserve them = in open source to prevent
issues or incompatibilities down the road.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Ian Campbell [Thu, 14 Jul 2011 08:33:38 +0000 (09:33 +0100)]
docs: correct typo in vbd-interface.txt
d1 is xvdb not xvda.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Keir Fraser [Thu, 14 Jul 2011 08:33:02 +0000 (09:33 +0100)]
merge
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:31:53 +0000 (09:31 +0100)]
doc: Update the com1,com2 section with pci and amt options.
The "xen: Automatically find serial port on PCI/PCIe and AMT devices."
provides the functionality to probe for the I/O base using the
"pci" and "amt" option. Update the documentation with this fact.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:31:12 +0000 (09:31 +0100)]
xen: Update pci_uart_config to save the BAR1 contents if com2 is used
Jan Beulich pointed out that the pci_uart_config can be called for
com2 and we should probe the second BAR instead of the first one.
This patch will probe the BAR0 if it is com1, and BAR1 if its com2.
It also cleans up some of the whitespace problems and changes the
name of the parameter and function from 'magic' to 'pci'.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:30:25 +0000 (09:30 +0100)]
xen: Restore the BAR and PCI command after resume.
Certain PCI serial cards just don't want to remember
what they are when they come out of resume. Save
the BAR and the PCI command values before we suspend and
write them back in when we resume.
Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
James Mckenzie [Thu, 14 Jul 2011 08:28:23 +0000 (09:28 +0100)]
xen: Automatically find serial port on PCI/PCIe and AMT devices.
Instead of having to manually look the right I/O port on the PCI
devices or AMT devices, lets probe the card and find that
automatically.
This means that you don't have to have this:
com1=115200,8n1,0xd800,0
But instead can have
com1=115200,8n1,magic
Or if you have AMT:
com1=19200,8n1,amt
Signed-off-by: James Mckenzie <jamesmck@bob.uk.xensource.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Jan Beulich [Thu, 14 Jul 2011 08:26:13 +0000 (09:26 +0100)]
x86-64: properly handle alias mappings beyond _end
Changeset 19632:
b0966b6f5180 wasn't really complete: The Xen image
mapping doesn't end at _end, but a full 16Mb gets mapped during boot
(and never got unmapped so far), hence all of this space was subject
to alias mappings when it comes to cache attribute changes. Unmap all
full large pages between _end and the 16Mb boundary, and include all
other pages beyond _end when checking for aliases.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Ian Jackson [Fri, 8 Jul 2011 17:35:24 +0000 (18:35 +0100)]
libxl: do not use tap disk backend other than for raw and vhd
tap does not support qcow/qcow2; update disk_try_backend accordingly.
Break out the "backend not suitable for this format" message so it can
be reused. Remove now-redundant reporting from
libxl_device_disk_local_attach and replace with abort().
Reported-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Zhigang Wang [Fri, 8 Jul 2011 17:12:26 +0000 (18:12 +0100)]
tools: fix shared loop device detection in block hotplug script
We need to cope with 0 or more '0' prefixed to '$dev':
# stat -c '%D' "/system.img"
13
# losetup -a
/dev/loop0: [0013]:
12062248 (/system.img)
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Fabio Fantoni [Fri, 8 Jul 2011 17:10:48 +0000 (18:10 +0100)]
tools: Improved LSB headers in init.d scripts
xendomains service now working also without xend service
Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Fri, 8 Jul 2011 12:23:05 +0000 (13:23 +0100)]
x86-64/EFI: discard .comment.* sections
The SuSE version of gcc produces a non-standard section named
.comment.SUSE.OPTs, but the PE32+ handling in binutils can't really
deal with any section to be placed at virtual address zero (and not
needing to be loaded). Even if binutils did, at least the UEFI
implementation in EDK 1.06 doesn't look at the section characteristics
at all, and hence would attempt to load such a section, and fail or
corrupt other data.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 8 Jul 2011 12:21:53 +0000 (13:21 +0100)]
x86-64/physdevop: reduce generated code duplication
At least all the helper functions can be used by both the native and
the compat-mode implementations, requiring their parameters to be
adjusted.
Additionally, rather than having the compat mode wrapper source file
blindly define the native structures to be replaced by the compat mode
ones, replace unnecessary (un-)definitions by layout match checks.
In a second step, do_physdev_op() could be split into a part that
needs
re-compilation for compat mode handling and one that can be used for
native and compat mode.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Fri, 8 Jul 2011 12:20:09 +0000 (13:20 +0100)]
Revert 23664:
3e3c0a8be9f9
Tim Deegan [Fri, 8 Jul 2011 10:44:23 +0000 (11:44 +0100)]
x86/mm: fix 32-bit p2m type lookups
23300:
4b0692880dfa moved a check for 0 into p2m_flags_to_type()
and removed it from its caller, but the new check is only
compiled in 64-bit builds.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Konrad Rzeszutek Wilk [Fri, 8 Jul 2011 07:42:30 +0000 (08:42 +0100)]
ns16550: Implement suspend handler.
For PCI type cards, you need to disable the timer code during
suspend. Otherwise during resume, the timer can be put on the
heap as its being resumed and corrupt it resulting in a crash.
Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
KUWAMURA Shin'ya [Fri, 8 Jul 2011 07:39:26 +0000 (08:39 +0100)]
[IA64] kexec: fix ia64 build
23408:
1fc3347850c7 causes the following error:
machine_kexec.c:106: error: static declaration of
'machine_kexec_get_xen' follows non-static declaration
/xen-unstable.hg/xen/include/xen/kexec.h:39: error: previous
declaration of 'machine_kexec_get_xen' was here
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Andrew Cooper [Fri, 8 Jul 2011 07:38:35 +0000 (08:38 +0100)]
KEXEC: disconnect all PCI devices from the PCI bus on crash
In the case of a crash, IOMMU DMA remapping gets turned off so that
the kdump kernel may boot. However, this is warned as being dangerous
in the VTD specification if a DMA transaction is in progress.
Also, in the case of a crash, DMA transactions and interrupts from
peripheral devices such as network cards are likely to keep coming in.
Without DMA remapping enabled, the transactions will be writing over
low memory, corrupting the crash state, and perhaps even the kdump
reserved memory.
Therefore, on the crash path, we can disconnect all PCI devices from
their respective buses so that they are no longer able to be DMA
busmasters. This reduces the risk of DMA transactions corrupting
state (and will also reduce spurious interrupts arriving to the kdump
kernel) until the kdump kernel and properly reset the PCI devices.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Jan Beulich [Fri, 8 Jul 2011 07:35:00 +0000 (08:35 +0100)]
libelf: "required" features should also be reported as "supported"
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 8 Jul 2011 07:34:29 +0000 (08:34 +0100)]
add privileged/unprivileged kernel feature indication
With our switching away from supporting 32-bit Dom0 operation, users
complained that attempts (perhaps due to lack of knowledge of that
change) to boot the no longer privileged kernel in Dom0 resulted in
apparently silent failure. To make the mismatch explicit and visible,
add feature flags that the kernel can set to indicate operation in
what modes it supports. For backward compatibility, absence of both
feature flags is taken to indicate a kernel that may be capable of
operating in both modes.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Kevin Tian [Fri, 8 Jul 2011 07:33:01 +0000 (08:33 +0100)]
xenpm: clean up print messages
Signed-off-by Kevin Tian <kevin.tian@intel.com>
Kevin Tian [Fri, 8 Jul 2011 07:32:37 +0000 (08:32 +0100)]
cpuidle: initialize default Cstate information
C0/C1 should be always available when cpuidle is enabled in Xen.
When there's case that Dom0 doesn't register ACPI Cstate information,
e.g. due to BIOS issue or acpi processor module is not installed,
this patch provides basic C0/C1 information available to xenpm tool.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Paul Durrant [Fri, 8 Jul 2011 07:31:10 +0000 (08:31 +0100)]
x86/hvm: Don't expose CPUID time leaf when not using PVRDTSCP
Some versions of Oracle's Solaris PV drivers make a check that the
maximal Xen hypervisor CPUID leaf is <= base leaf + 2 and refuse to
work if this is not the case. The addition of the time leaf makes the
maximal leaf == base leaf + 3 so this patch introduces a workaround
that obscures the time leaf unless PVRDTSCP is in operation.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Christoph Egger [Fri, 8 Jul 2011 07:30:56 +0000 (08:30 +0100)]
nestedsvm: allow l1 guest to use OSXSAVE
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Liu, Jinsong [Fri, 8 Jul 2011 07:30:41 +0000 (08:30 +0100)]
x86 cpu: Fix bug: unify cpu_dev attr as __cpuinitdata
Currently different x86 cpu define different attr for cpu_dev.
Some cpu define as __initdata, this would be risk under cpu hotplug.
This patch fix the bug, unify them as __cpuinitdata, as what AMD cpu
define now.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Shan, Haitao <haitao.shan@intel.com>
Ian Jackson [Thu, 7 Jul 2011 11:35:05 +0000 (12:35 +0100)]
libxl: fix incorrect return of ERROR_INVAL from disk_try_backend
disk_try_backend is supposed to return 0 or the disk backend format.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 6 Jul 2011 17:26:49 +0000 (18:26 +0100)]
libxl: sane disk backend selection and validation
Introduce a new function libxl__device_disk_set_backend which
does some sanity checks and determines which backend ought to be used.
If the caller specifies LIBXL_DISK_BACKEND_UNKNOWN (which has the
value 0), it tries PHY, TAP and QDISK in that order. Otherwise it
tries only the specified value.
libxl__device_disk_set_backend (and its helper function
disk_try_backend) inherit the role (and small amounts of the code)
from validate_virtual_disk. This is called during do_domain_create
and also from libxl_disk_device_add (for the benefit of hotplug
devices).
It also now takes over the role of the scattered fragments of backend
selection found in libxl_device_disk_add,
libxl_device_disk_local_attach and libxl__need_xenpv_qemu. These
latter functions now simply do the job for the backend they find has
already been specified and checked.
The restrictions on the capabilities of each backend, as expressed in
disk_try_backend (and to an extent in libxl_device_disk_local_attach)
are intended to be identical to the previous arrangements.
In 23618:
3173b68c8a94 combined with 23622:
160f7f39841b,
23623:
c7180c353eb2, "xl" effectively became much more likely to select
TAP as the backend. With this change to libxl the default backend
selected by the libxl__device_disk_set_backend is intended to once
again to be PHY where possible.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Olaf Hering [Wed, 6 Jul 2011 15:32:16 +0000 (16:32 +0100)]
libxl: testenum.c depends on libxl.h
testenum.c may fail to compile if libxl.h dependencies are not yet met.
In file included from testenum.c:3:
libxl.h:199:26: error: _libxl_types.h: No such file or directory
In file included from testenum.c:3:
libxl.h:203: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
....
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Mon, 4 Jul 2011 06:57:32 +0000 (07:57 +0100)]
x86: Couple of small cleanups after cpuid faulting patch.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Sat, 2 Jul 2011 08:08:27 +0000 (09:08 +0100)]
x86: Remove redundant cpuid-faulting-related BUG_ON I added.
Signed-off-by: Keir Fraser <keir@xen.org>
Liu, Jinsong [Fri, 1 Jul 2011 21:28:53 +0000 (22:28 +0100)]
x86: cpuid faulting feature enable
Latest Intel processor add cpuid faulting feature. This patch is used
to support cpuid faulting in Xen. Like cpuid spoofing, cpuid faulting
mainly used to support live migration. When cpuid faulting enabled,
cpuid instruction runs at cpl>0 will produce GP, vmm then emulate
execution of the cpuid instruction. Hence will appear to guest
software the value chosen by the vmm.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Christoph Egger [Fri, 1 Jul 2011 19:48:00 +0000 (20:48 +0100)]
nestedsvm: fix handling of invalid virtual vmcb
When the l1 guest sets up an invalid vmcb then inject VMEXIT(#INVALID)
rather having the host sitting in an endless loop of injecting #UD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Jan Beulich [Fri, 1 Jul 2011 19:46:54 +0000 (20:46 +0100)]
x86: remove the domain parameter from the guest EOI functions.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:45:21 +0000 (20:45 +0100)]
x86: make domain_spin_lock_irq_desc() a wrapper of pirq_spin_lock_irq_desc()
...and drop the now unused struct domain * parameter of the latter.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:44:50 +0000 (20:44 +0100)]
x86: remove unnecessary ALIGN directives
ENTRY() already includes an ALIGN.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:44:21 +0000 (20:44 +0100)]
x86-64/mmcfg: fix pci_mmcfg_arch_free()
While only used on error paths so far, it should still actually do
something (which iounmap(), being an empty stub, doesn't).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:43:55 +0000 (20:43 +0100)]
x86: streamline page fault path
#PF is, in all "normal" usage models, the only potentially high
frequency (and hence performance sensitive) exception. Thus make it
the fall-through case into handle_exception (rather than
divide_error for x86-32 and not having one at all for x86-64).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:43:02 +0000 (20:43 +0100)]
x86: adjust pirq_spin_lock_irq_desc()
Remove unnecessary/bogus assertions and add retry loop matching
domain_spin_lock_irq_desc().
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:42:22 +0000 (20:42 +0100)]
x86/EFI: adjust installation logic
We should always install xen.efi into /usr/lib64/efi/; installation
into /boot/efi/efi/$(EFI_VENDOR) remains dependent upon specifying
EFI_VENDOR.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Fri, 1 Jul 2011 19:41:43 +0000 (20:41 +0100)]
x86/EFI: fix interrupt and fault handling during runtime services calls
The missing piece was the setting up of an accessible GDT prior to
switching page tables (and reverting to the original setting after
having established the normal page tables again afterwards).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
George Dunlap [Fri, 1 Jul 2011 19:31:18 +0000 (20:31 +0100)]
xentrace: Allow tracing to be enabled at boot
Add a "tevt_mask" parameter to the xen command-line, allowing
trace records to be gathered early in boot. They will be placed
into the trace buffers, and read when the user runs "xentrace".
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
George Dunlap [Fri, 1 Jul 2011 19:29:35 +0000 (20:29 +0100)]
xentrace: Add tracing for IRQ-related events
Add tracing for various IRQ-related events. Also, move
the exiting TRC_TRACE_IRQ from the "generic" class into the
new TRC_HW_IRQ sub-class.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
George Dunlap [Fri, 1 Jul 2011 19:22:38 +0000 (20:22 +0100)]
xentrace: Make a new hardware-related trace class
Power management seems a very narrow focus for its own class, of
which we have a limited number due to the layout of the trace
records. Make a hardware-event trace class, and move power management
events into a subclass of those.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Tim Deegan [Thu, 30 Jun 2011 10:01:04 +0000 (11:01 +0100)]
x86/mm: fix the non-debug build
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: use a linked list for LRU np2m selection.
Because the flush-all-np2ms op doesn't take the np2m lock any more
we can't reorder the p2ms in the array that it will walk.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
x86/p2m: Add p2m_change_type_range() operation
that defers the nested-p2m flush until the entire batch has been updated.
Use it in the HAP log-dirty operations for tracking VRAM changes.
This should avoid a lot of unpleasant IPI storms as the log-dirty code
on one CPU repeatedly shoots down the nested p2m of another CPU.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: rework locking around nested-p2m flushes and updates.
The nestedp2m_lock now only covers the mapping from nested-cr3 to
nested-p2m; the tables themselves may be updated or flushed using only
the relevant p2m lock.
This means that the nested-p2m lock is only taken on one path, and
always before any p2m locks.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: flush only one p2m table when reallocating.
It's unhelpful to flush all of them when we only need one.
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: clarify logic in p2m_get_nestedp2m()
This just makes the behaviour of this function a bit more explicit. It
may be that it also needs to be changed. :)
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: remove bogus check of CR3 value.
0 is a valid CR3 value; CR3_EADDR isn't but there's nothing stopping a
guest from putting it in its VMCB. The special case was broken anyway
since AFAICT "p2m->cr3" is a nester-cr3 (i.e. p2m-table) value and
guest_cr[3] is an actual-cr3 (pagetable) value.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Tim Deegan [Thu, 30 Jun 2011 09:26:54 +0000 (10:26 +0100)]
Nested p2m: implement "flush" as a first-class action
rather than using the teardown and init functions.
This makes the locking clearer and avoids an expensive scan of all
pfns that's only needed for non-nested p2ms. It also moves the
tlb flush into the proper place in the flush logic, avoiding a
possible race against other CPUs.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Konrad Rzeszutek Wilk [Tue, 28 Jun 2011 17:15:44 +0000 (18:15 +0100)]
libxc: Squash xc_e820.h (and delete) into xenctrl.h
.. as there is no need to keep that internal header file anymore.
We export two functions xc_domain_[set|get]_memory_map which
depend on the 'struct e820entry' defined in 'xc_e820.h'.
We move the contents of the 'xc_e820.h' to the 'xenctrl.h' fixing
compiler errors when applications outside the Xen tree are trying
to compile against the libraries.
Tested-by: Daniel Castro <evil.dani@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Tue, 28 Jun 2011 13:45:36 +0000 (14:45 +0100)]
x86_32: Fix buil dafter EFI MPS patch.
Signed-off-by: Keir Fraser <keir@xen.org>
Ian Jackson [Tue, 28 Jun 2011 13:01:53 +0000 (14:01 +0100)]
QEMU_TAG update
Roger Pau Monne [Tue, 28 Jun 2011 12:56:53 +0000 (13:56 +0100)]
xend: NetBSD portability fix for LVM raw volume names
Xen 4.1.1 was incorrectly passing /dev/rmapper/vg-lvname to pygrub
(notice the r in front of mapper), when it should pass
/dev/mapper/rvg-lvname (add the r to the last file) when using NetBSD.
I've patched it to work correctly. I'm attaching a unified diff with
the patch made against Xen 4.1.1 (it's a really simple modification).
From: Roger Pau Monne <roger.pau@entel.upc.edu>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:17 +0000 (12:19 +0100)]
xl: new "check-xl-disk-parse" test script for disk parser
This runs "xl -N block-attach 0 <some strings>" for various sets of
strings and checks that the output is as expected.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:17 +0000 (12:19 +0100)]
xl: xl block-attach -N (dry run) option
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:16 +0000 (12:19 +0100)]
xl: implement -N (dry run) global option for create and cpupool-create
These subcommands already had "-n" dry run options. Make -N do the
same thing, and deprecate those -n options.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:15 +0000 (12:19 +0100)]
xl: new global -N option for dry run
This sets a global dryrun_only variable, which individual commands are
expected to honour. To avoid accidents, we introduce a new can_dryrun
member in the command table, which is initially set to 0 for each
command.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:15 +0000 (12:19 +0100)]
libxl: disks: allow specification of "backendtype=phy|tap|qdisk"
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:14 +0000 (12:19 +0100)]
xl: disks: replace block-attach disk config parser with call to xlu_parse_disk
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:13 +0000 (12:19 +0100)]
xl: disks: replace config file disk spec parser with call to xlu_disk_parse
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:13 +0000 (12:19 +0100)]
docs: update xl-disk-configuration.txt to describe new syntax
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:12 +0000 (12:19 +0100)]
libxl: disks: commit libxlu_disk_l.[ch] flex output
Commit the flex output into revision control, for the benefit of those
without flex or with only very old flex. This change is split into a
separate patch for ease of review. Generated with flex 2.5.35-6 on
Debian lenny i386, by running "make" in the libxl directory. No
manual changes in this commit.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:11 +0000 (12:19 +0100)]
libxl: disks: new xlu_disk_parse function
Introduce new flex/regexp-based parser for disk configuration strings.
Callers will be updated in following patches.
The existing xm command line syntax for block-attach expects multiple
arguments containing different parameters for different parts of the
disk specification, so we supply a parser function which can take
multiple strings and scan them in sequence.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 28 Jun 2011 11:19:10 +0000 (12:19 +0100)]
libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work
libxl callers should not be required to specify the backend if they
don't want to. So LIBXL_DISK_BACKEND_UNKNOWN should instruct libxl to
choose the backend for itself.
For now, we do this by simply treating it the same as BACKEND_TAP,
which itself falls back to other methods.
More thorough fixes for the disk handling will follow.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Keir Fraser [Tue, 28 Jun 2011 08:26:24 +0000 (09:26 +0100)]
hgignore: Add EFI-related auto-generated files.
Signed-off-by: Keir Fraser <keir@xen.org>
Jan Beulich [Tue, 28 Jun 2011 08:21:28 +0000 (09:21 +0100)]
x86-64: EFI MPS support
It's not clear this is needed - Linux doesn't use the MPS table even
if available, and no system having one was seen so far.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Tue, 28 Jun 2011 08:20:49 +0000 (09:20 +0100)]
x86-64: EFI runtime code
This allows Dom0 access to all suitable EFI runtime services. The
actual calls into EFI are done in "physical" mode, as entering virtual
mode has been determined to be incompatible with kexec (EFI's
SetVirtualAddressMap() can be called only once, and hence the
secondary kernel can't establish its mappings). ("Physical" mode here
being quoted because this is a mode with paging enabled [otherwise
64-bit mode wouldn't work] but all mappings being 1:1.)
Open issue (not preventing this from being committed imo):
Page (and perhaps other) faults occuring while calling runtime
functions in the context of a hypercall don't get handled correctly
(they don't even seem to reach do_page_fault()). I'm intending to
investigate this further.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Tue, 28 Jun 2011 08:19:35 +0000 (09:19 +0100)]
x86-64: EFI boot code
Besides introducing the relevant code paralleling parts of what is
under xen/arch/x86/boot/, this adjusts the build logic so that with a
single compilation two images (gzip-compressed ELF and EFI
application)
can get created. The EFI part of this depends on a new enough compiler
(supposedly gcc 4.4.x and above, but so far only tested to work with
4.5.x) and a properly configured linker (must support the i386pep
emulation). If either functionality is found to not be available, the
EFI part of the build will simply be skipped.
The patch adds all code to allow Xen and the (accordingly enabled)
Dom0 kernel to boot, but doesn't allow Dom0 to make use of EFI
runtime calls (this will be the subject of the next patch).
Parts of the code were lifted from an earlier never published OS
project of ours - whether respective license information needs to be
added to the respective source file is unclear to me (I was told
internally that adding a GPLv2 license header can be done if needed by
the community).
Open issues (not preventing this from being committed imo):
The trampoline allocation and initialization isn't really nice. This
is due to the trampoline needing to be placed at a fixed address, and
hence making the trampoline relocatable would seem desirable here (as
well as for BIOS-based booting, where the trampoline location needed
to be adjusted a number of time already in the past, due to it
colliding with firmware data).
By excluding mem.S, edd.S, and video.S from copied trampoline (i.e.
moving up wakeup.S? and making sure none of the symbols are used from
EFI code), the effective trampoline size could at least be reduced.
Should the mappings of [__XEN_VIRT_START, mbi.mem_upper) and
[_end, __XEN_VIRT_START+BOOTSTRAP_MAP_BASE) be destroyed, despite
non-EFI code also keeping them?
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Jan Beulich [Tue, 28 Jun 2011 08:17:50 +0000 (09:17 +0100)]
x86-64: EFI header files
Taken from gnu-efi-3.0k (slightly edited).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Tim Deegan [Tue, 28 Jun 2011 08:16:13 +0000 (09:16 +0100)]
x86: fix boot-time watchdog test.
Since the perf counter that the LAPIC NMI watchdog uses only
runs while the core isn't halted, and all APs are idle at
this point in the boot process, it's possible that remote
CPUs won't see any NMIs during the 10-tick waiting period.
Force all CPUs to busy-wait so we know the timers are running.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Wei Huang [Tue, 28 Jun 2011 08:13:53 +0000 (09:13 +0100)]
x86: AMD core-pair topology detection code
This patch is to support core-pair topology introduced by AMD CPUs,
which introduces a new concept of [core, compute unit]. There is a new
feature bit for topology extension in CPUID:0x80000001. Also a new
CPUID 0x8000001E is introduced for CPU topology enumeration. This
patch collects the sibling information from the new CPUID and will be
stored in the sibling map in Xen hypervisor.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Wei Huang [Tue, 28 Jun 2011 08:13:31 +0000 (09:13 +0100)]
x86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct
This patch moves cpu_core_id and phys_proc_id into cpuinfo_x86
structure. This is similar to upstream Linux kernel's approach.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
James Carter [Tue, 28 Jun 2011 08:11:04 +0000 (09:11 +0100)]
xen/xsm/flask: Fix flask_tbufcontrol hook
The flask_tbufcontrol hook currently calls domain_has_xen with the
second argument being a class (SECCLASS_XEN) instead of a permission.
This patch fixes the hook so that it passes the XEN__TBUFCONTROL
permission instead.
Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
James Carter [Tue, 28 Jun 2011 08:10:43 +0000 (09:10 +0100)]
xen/xsm: Add missing dummy operation
This patch adds a dummy op for the xsm_vcpuextstate operation.
Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
Marek Marczykowski [Mon, 27 Jun 2011 16:37:12 +0000 (17:37 +0100)]
libxl: Do not SEGV when no 'removable' disk parameter in xenstore
Just assume disk as not removable when no 'removable' paremeter
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Marek Marczykowski [Mon, 27 Jun 2011 16:34:01 +0000 (17:34 +0100)]
xen.lowlevel.xl: Return None on empty domain name
Previously PyString_FromString(NULL) was called, which caused assertion
failure.
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Marek Marczykowski [Mon, 27 Jun 2011 16:28:52 +0000 (17:28 +0100)]
libxl: Remove frontend and backend devices from xenstore after destroy
Cleanup frontend and backend devices from xenstore for all dev types - not only
disks. Because backend cleanup moved to libxl__device_destroy,
libxl__devices_destroy is somehow simpler.
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Marek Marczykowski [Mon, 27 Jun 2011 16:27:08 +0000 (17:27 +0100)]
libxl: Accept disk name in libxl_devid_to_device_disk
Accept disk name in xl block-detach.
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Marek Marczykowski [Mon, 27 Jun 2011 16:24:50 +0000 (17:24 +0100)]
libxl: Allocate memory for strings in libxl_device_disk
Memory for strings in libxl_device_disk must be allocated from outside of
libxl__gc to not be freed at the end of function (by libxl__free_all).
Fixes xl block-detach
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Marek Marczykowski [Mon, 27 Jun 2011 16:20:55 +0000 (17:20 +0100)]
xl: Use macros for param parsing in network-attach
'script=' length was wrong... Replaced calls to strncmp("param", *argv,
explicit sizeof("param")) with macro and helper function to extract parameter
value. Also introduce replace_string function to simplify code.
Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>